package com.xiaobias.mySwitch;

public class Switch004 {

    public static void main(String[] args) {
        System.out.println(testPatterMatchSwitch(1111L));
    }

    private static String testPatterMatchSwitch(Object o) {
        return switch (o) {
            case null -> "o is null";
            case Integer i -> String.format("Integer i : %s", i);
            case Long l -> String.format("Long l : %s" , l);
            case Double d -> String.format("Double d : %s", d);
            case String s -> String.format("Stirng s : %s", s);
            default -> o.toString();
        };
    }
}
